define([ "app", "jquery", "md5", "ecb","artDialog","iframeTools","pagination",  "services/UserService","services/TipsService",
		"directives/AudioPlayer",
		"resources/company/CompanyResource", 
		"resources/UserResource", "resources/ShareResource" ],
		function(app) {
			var deps = [ "$scope", "$state","$sce", "$timeout", "$window", "$location", "$stateParams","TipsService", "UserService", "UserResource", "ShareResource","CompanyResource" ];

			function controller($scope, $state,$sce,$timeout, $window, $location, $stateParams,TipsService, UserService, UserResource, ShareResource,CompanyResource) {
				
				
				$scope.currentPage = 1;
		        $scope.pages = [];
		        $scope.pageSize = 10;
		        
				init()
				
				function init(){
					CompanyResource.queryLoginLogs(1,3,1).success(function(data){
						$scope.data = data.obj.loginLogList;
		            });
					
					CompanyResource.queryLoginLogs(1,10,2).success(function(data){
						
						var obj = {
						    wrapid:'wrap1', //页面显示分页器容器id
						    total:data.obj.count,//总条数
						    pagesize:10,//每页显示10条
						    currentPage:1,//当前页
						    onPagechange:onPagechange,
						    //btnCount:7 页数过多时，显示省略号的边界页码按钮数量，可省略，且值是大于5的奇数
						}
						pagination.init(obj);
						
						$scope.history = data.obj.loginLogList;
		            });
				}
				
				var onPagechange = function(page){
					CompanyResource.queryLoginLogs(page,10,2).success(function(data){
						
						var obj = {
						    wrapid:'wrap1', //页面显示分页器容器id
						    total:data.obj.count,//总条数
						    pagesize:10,//每页显示10条
						    currentPage:page,//当前页
						    onPagechange:onPagechange,
						    //btnCount:7 页数过多时，显示省略号的边界页码按钮数量，可省略，且值是大于5的奇数
						}
						//pagination.init(obj);
						$scope.history = data.obj.loginLogList;
		            });
				}
				
				
			}
			controller.$inject = deps;
			return app.lazy.controller("LoginLogManagementController", controller);
		});
